04 - Electronics Production
Fabricating My Own PCB
With this week's topic, electronics production, we start with a series of lectures about electronics. Over the next few weeks, we will deal with electronics production, then with embedded programming and lastly with electronics design. Apparently, in the previous years, the sequence of these topics, what should come first and what is last, caused a lot of discussions. In this year, the instructors try a new sequence.
Starting with electronics production, this week's assignment were:
- Group Assignment
- Characterize the design rules for your in-house PCB production process
- Send a PCB out to a board house
- Individual Assignment
- Make and test a microcontroller development board
- For extra credit personalize the board
- For extra credit make it with another process
Group Assignment
The documentation of the group assignment is hosted on a different website. You can find it here. However, I would like to evaluate on my own website, what I have learned this week.
There were mainly two tasks, namely characterizing the design rules of the in-house PCB production process and sending the PCB to an external manufacturer.
Characterizing the Design Rules
For characterizing the design rules, we only had to mill some traces with different widths and clearings. This test has to be done for both available machines, the Roland MDX-40 and the LPKF ProtoMat S104.
The first test was done on the Roland. For this machine, the file with the test traces and clearings was available here. I was quite surprised that this file is "only" a .png file and not a vector graphics. However, we used a website called mods CE as a CAM processor to convert the png to the tool paths. Here, it is really important to adjust the settings right. For example, the Roland will be using a V-bit as a milling tool. For this tool, the width of the milled traces depends on the depth of the tool. Therefore, the traces are in 3D and not only 2D.
This however also means that the z-axis of the Roland needs to be zeroed very precisely and small offsets can have a significant impact on the width of the traces. Additionally, other aspects can effect the outcome a lot. These are for example the fixture of the material on the bed, the condition of the tool and accurate settings.
When we started milling the test cut on the Roland the first time, we tried to set the z-axis to zero right above the material by loosening the milling bit, pulling it down so that it barely touches the material and then tightening it again. However, this resulted in the zeroing being really off potentially as tightening the bit pushed the milling bit slightly up. For our instructor, it was very clear that the zero was off as a lot of white dust appeared. Initially, I did not know that it was too much as I had no reference, but now, after I saw a good cut, I really must say it was really obvious as the dust piled up around the mill bit. Ideally, the dust only sprinkles the surface of the copper slightly such that the user is still able to see most of the traces. Also, noise can be an indicator for a good dept of the milling bit but for this the surroundings must be really quiet.
On the second try to set the z-axis of the Roland, loosened, positioned and tightened the milling bit in the same way. But we only used this as a rough estimate. In addition, we started the spindle and slowly moved the milling bit down with the buttons in the software for controlling the position until we started seeing the slightest dust on the copper. This test cut must be done in a spot where it does not matter for the actual cut. In total, we discovered that the spindle had to be moved down by quite a lot, by 0.15 mm, after loosening, positioning and tightening the milling bit to get the (almost) perfect depth of the V-bit.
You can see below, that we really got the (almost) perfect zero position for the z-axis as even the smallest trace on the very left is visible. I would however not recommend to use this width but rather use a width of at least 0.07 mm just to be on the safe side. For the clearance, the width must be at least abut 0.2 mm as only few clearances on the very right were milled. However, this is due to the V-bit which has a (minimum) width of 0.2 mm at the very tip. Therefore, not even the file for the toolpaths shows paths to mill the clearances smaller than that.
Later, my fellow students and I were also using the other PCB milling machine, the LPKF ProtoMat S104. This machine is actually really easy to use as it automates very many processes e.g. the tool change or setting the zero of the z-axis. It is therefore a lot more precise. You can see it also in the image below. The LPKF was able to cut all traces and clearances except for the smallest clearance. However, you can see that the trace were not completely isolate from the rest, and therefore, not only one but potentially more passes are needed to achieve this.
External Fabrication
In case a board should be manufactured more professionally, the design of the PCB can be sent to a board house. The process for this is actually surprisingly easy. For the group assignment, we decided to use the JLCPCB.
Firstly, the gerber file of the design needs to be uploaded. In our case, it was only a standard PCB with one to four layers. However, there are also options for advanced PCBs with more layers, stencils and so on. Next, several choices have to be made. These include e.g. the material, dimension, color, surface finish and the quantity. Additionally, the user can specify if they want an assembled PCB or an additional stencil for the surface mount components.
Once, the specifications were adjusted to the needs of the user, the object can be ordered and payed.
Specifications for External Fabrication at JLCPCB
Further Specifications for External Fabrication at JLCPCB
Individual Assignment
The individual assignment consisted of making and testing a microcontroller development board, also called a printed circuit board (PCB). There are many different fabrication processes of PCBs. However, all of them follow these steps:
- Specification of Board Requirements
- CAD of PCB
- PCB Fabrication File
- CAM Processing
- PCB Fabrication
- Soldering
- Testing
- Programming
These steps include the electronics design in the beginning that end at the PCB fabrication file. This file can then be used to produce (and test) the electronics and lastly, the PCB can be programmed, which is called embedded programming.
Despite the fact, that this week's topic only includes electronics production, it cannot be fully taught without touching the other two topics as there is a certain overlap. Additionally, our local instructor will probably be on an excursion during the week with the topic of electronics design. Hence, he wanted to give us a headstart and teach basic skills in electronics design using a software called KiCAD. It really was a lot of content this week, but our instructor was really patient with us.
During the local lecture, we skipped however the first step, specifying the board requirements, as this would have meant to teach even more. Instead our instructor has set the board requirements and we simply followed the steps he did in Hence, we started with the PCB CAD and stopped after testing. Embedded programming will then be taught soon, in fact, already in the sixth week. Click here to go to its documentation.
CAD of PCB
For designing the PCB with Computer-Aided Design (CAD), we used a software called KiCAD. I basically followed the steps, that our instructor did up to a finished PCB and then personalized it slightly.
After downloading and installing KiCAD, I opened the software and created a new project with File > New Project. This created a .kicad_sch and .kicad_pcb file which contain the details for the schematics of the electronics with its logic and the actual physical layout of the PCB, respectively. As the logic of the board is needed before creating the layout, firstly the schematics (.kicad_sch) and secondly the PCB (.kicad_pcb) is designed. However, before anything can be created in KiCAD, the libraries for footprints and symbols must be adjusted.
Preparing KiCAD
In order to prepare KiCAD for using it within FabAcademy, I downloaded this folder from GitLab which contains the libraries for footprints and symbols. After unzipping it into a folder that I named "fab", I started to define the paths for the libraries.
I started with configuring the paths via Preferences > Configure Paths... where I added the downloaded and unzipped folder "fab" and naming this path "FAB". Next, I included the symbol library by clicking at Preferences > Manage Symbol Libraries... and inputting the library path $(FAB)/kicad-master/fab.kicad_sym with its nickname "fab". Lastly, I included the footprint library via Preferences > Manage Footprint Libraries.... Here, I added the library path $(FAB)/kicad-master/fab.pretty nicknaming it "fab".
In addition to the FabAcademy libraries, I needed the library for the microcontroller that I used, namely the Seeed Studio XIAO SAMD21, also called Seeeduino. For this, I followed the tutorial on their website. I used the nickname "samD21" for the libraries.
Schematic Design
After including the libraries of FabAcademy and for the microcontroller, I started designing the schematics. For this, I opened the .kicad_sch file in the project, that I created earlier. It opened another window which looked a lot like a technical drawing file.
It is good practice to firstly adjust the page settings which can be done by double-clicking on the table in the bottom right corner. This opens a dialog where I input some information about date, the name, the author and institution. This allows anybody who opens the file to assess who has created this file, when it was created and maybe what it is.
After this, I was able to get started with designing the logics. The first step was adding the microcontroller. Clicking on "Add a Symbol (A)" on the right or pressing the key "A" opens a dialog showing the symbol library. Simply by searching for "samD21", I was able to find the component "SeeduinoXIAO" in the library "samD21" as I have named it earlier.
I selected this component and clicked on "OK" which lead me back to the initial screen. Here, I was now able to place the symbol of the Seeeduino on the schematics drawing.
After this, I added some power symbols. For this, I clicked on "Add a Power Symbol (P)" on the right, which again opened a dialog with the symbol library. However, it was now restricted to symbols concerning the power. Hence, I added a 5 V symbol to the 5V pin, a 3.3V symbol to the 3.3V pin and GND to the ground pin.
In addition to power symbols, I also added a no-connection flag by clicking on the according button on the right, which consists of an "X". Instead of leaving the connection empty, a no-connection flag should be used as it is cleaner. I added these onto the 5 V pin and the GND pin in the bottom as well as all the pins in the top, just like our local instructor did. He said that it can be done as the 5V and GND pins are connected internally and only one power and ground is needed. Additionally, I added a no-connection flag to the pins in the top as this would have required to solder between the board and the microcontroller, which is apparently really advanced.
The next steps that my instructor did were not all really clear to me. In principle I got, how I did it, but not really why. I guess however that I will be learning more about it in electronics design and in the topics about input devices, output devices and networking and communications. These steps consist in the adding of rows of pins, also called pin headers. They can later be connected to other components like sensors, motors and other boards. Precisely, I added six times the "Conn_PinHeader_1x04_P2.54mm_Vertical_THT_D1.4mm" from the "fab" library, which is a row of four pins with a through hole and a diameter of 1.4mm. The same pins but in a row of three was added one time.
The first two 1x04 pin headers were used for some networking connections, namely Rx/Tx and I2C. The outer pins of the pin headers were connected to 5V and ground, respectively, the inner pins however to the Rx and Tx or SDA and SCL pins of the microcontroller. Here, instead of placing wires between the pins, I used global labels as it makes it a lot cleaner. A global label can be added via the "Add a Global Label" button on the right. The software knows there is a connection between places where the same labels are used.
The third pin header, the pin header with three pins in a row, was also used for networking, here for SPI. This was directly connected to the MOSI, MISO and SCK pin on the right side of the microcontroller.
Next, I added a 1x4 pin header to allow for input/output (I/O) and connected it to the remaining pins on the top left. Additionally, I added three 1x4 pin headers which were all connected to the ground, to 5V and to 3.3V.
Our instructor wanted to generate a board, that I can use in the following weeks for other topics as well. Hence, I also added an LED which should light up as soon as power is supplied, and another LED which can be accessed via a pin as an output. These however also needed a resistor between the power (or the pin) and the ground. These symbols are the "LED_1206" and "R_1206" entry in the "fab" library.
Lastly, I added a button, which is the "Button_CUIDevices" symbol of the "fab" library. To access whether it is pressed, one side is connected to a pin and to the power and the other to the ground. However, to avoid a short circuit as soon as the button is pressed, the power had to be connected to the button via a very strong resistor with more than ten kiloohms. This is called a pull-up resistor.
In total, the schematics of the PCB looked like this:
With the schematics being done, I saved the file and proceeded with the board layout by pressing a green button in the top row of buttons saying "Open PCB in Board Editor".
Designing the Board Layout
Once the schematics were done, I proceeded with the physical layout of the PCB. Initially, when opening the board editor to edit the .kicad_pcb file, the page is empty.
Hence, I first had to update the file by pressing a button on the right of the top row of buttons saying "Update PCB with changes made to schematics".
The components hence appeared on the screen following my mouse movements. Here, I clicked in the middle of the page, which positioned the components at this place. The layout looks really tidy and neat but the physical layout was not possible. It had no connections yet.
Therefore, a first step for laying out the components was moving them farther apart. This now allowed me to see where and between what components connections had to be established as indicated by small bright lines, called ratsnet wires.
As soon as I was able to see them, the layout of the components can be improved. It is really difficult to explain how a layout is made but it involves a lot of logic, intuition and trying. For example, it makes sense if the component "J6", the pin header connecting to the 5V pin is positioned horizontally on the right of the 5V pin. The same is valid for the 3.3V pin header and the 3.3V pin.
Additionally, the I/O pin header should be positioned on the op left. Below, the I2C pin header might be positioned. The Rx/Tx pin header probably is best positioned horizontally at the bottom and the SPI pin header close to the bottom right pins.
The procedure to position the remaining components, the button, LEDs, resistors and the ground pin header, is not so straight forward. When I placed these components, I only followed the steps my instructor made without knowing why. However, later, I got to know the reason: The whole pcb plate will be the ground and only traces for pins and power will be milled to disconnect them from the complete ground. If it is not clear to you yet, see below. You will see what I mean.
After a while, I had roughly arranged the components as shown below.
After pressing "OK" on the dialog, I created a closed rectangle around the components. Pressing the key "B" filled the rectangle with a slightly transparent red color as shown below. It needs to be pressed every time anything is changed within the rectangle, e.g. a new wire is placed or components are moved. If you look closely, the filling does not touch the contacts of the components but rather has a thick dark border, i.e. a clearance, around them. Hence, none of the pins are actually connected to that zone. There are only few exceptions, namely all pins and contacts that need to be connected to ground. For example the second pin from the top on the right side of the microcontroller is crossed by a line with the same color as the filled zone. Similarly, the ground zone is also connected to contacts of the LEDs, the button and the ground pins of the pin headers.
Then, before I got started with wiring the components, I had to adjust the seeting for the traces. For this, I clicked on File > Board Setup... which opened a dialog. Here, under Design Rules > Net Classes, I specified the clearance and track width to be 0.5 mm and 0.45 mm.
Next, I connected the components with tracks by using the "Route Tracks" tool that is available at the according button on the right. During this task, I also moved components closer to the microcontroller to get a more compact layout than the preliminary rough layout. Sometimes, I pressed the Ctrl key while moving a component to avoiding any snapping to the grid. While routing the tracks, I always tried to avoid any angled exit or entrance of the contacts/pins and instead generate horizontal or vertical tracks. In the end, I pressed "B" to update the ground zone.
As a last feature, I included my initials in the bottom left of the PCB as a personalization by using tracks.
As a very last step of the design, I had to create paths where the PCB should be cut. For this, I drew a rectangle around the components and moved the bottom, left and right edges close to the components with slight spacing. The top edge however had to be close to the body of the microcontroller. Hence, I moved it onto the top edge of the microcontroller's body while pressing Ctrl.
The define the edges of the rectangle to be cut, I right-clicked on the rectangle and selected properties. This opened a dialog which allowed me to move this rectangle to the layer called "Edge.Cuts".
After closing the dialog, the physical layout of the PCB was finished.
PCB Fabrication File
After designing the board layout, the fabrication file has to be generated. For some machines, the export is just an image, e.g. with a .png or .svg file format. However, the mill we are using, the LPKF ProtoMat 1S04, needs Gerber files. These can be exported by clicking on File > Fabrication Outputs > Gerbers (.gbr)...
By this, another dialog opened. In there, I only selected the "F.Cu" and "Edge.Cuts" layer to be included and unselected all "Plot on All Layers". I did not change the remaining settings and left them as the default settings. Then I proceeded to adjust the settings for the drill file by clicking on "Generate Drill Files...".
Another dialog opened, where I selected "PTH and NPTH in single file" on the "Drill File Format" area, set the "Drill File Origin" to "Absolute" and the "Drill Units" to "Millimeters". Here, the remaining settings were left at the default.
Lastly, I pressed "Generate Drill File" which closed the second dialog and "Plot" on the first dialog. By this, four files were created, one drill file with a .drl ending, two Gerber files, one for each layer, namely an Edge-Cuts.gbr and F-Cu.gbr file, and lastly a Gerber Job file with a .gbrjob ending.
CAM Processing
For milling the PCB, we are using a LPKF ProtoMat S104 PCB mill. It comes with a software, that includes a CAM processor and controls the board production, which is called LPKF CircuitPro. This software was opened on the computer connected to the mill.
In the beginning, the software opens a window, but also a dialog called "New Document". This dialog can also be accessed via File > New. In this dialog, I chose the "SingleSided_Top.cbf" from the templates tab by double-clicking.
Then, the files need to be imported. This can be done by clicking on File > Import.. and selecting the two .gbr files, Edge-Cuts.gbr and F-Cu.gbr, as well as the drill file with the .drl ending.
After importing the files, the layers are shown on the right in the table along with its properties regarding manufacturing. However, I had to click on "Hide empty" above it to show only the relevant layers, in this case three.
For the top two layers, the properties were correct. However, for the drilling layer, the properties for "Tech" and "Phase" were missing, which I set to "Drilling" and "DrillingUnplated".
To generate the machine files containing the toolpaths, I pressed on a button just above the table, which said "Generate isolation and contour routing toolpath".
This opened another dialog called "Technology Dialog" where I was able to adjust the settings.
In this dialog in the very top are the global material settings, where I selected FR4 as the material type and a copper layser thickness of 0.35 microns.
In the first tab "Isolate", I selected the "Universal Cutter 0.2 mm" as the primary tool and unselected all available tools except for this one. Additionally, I changed the default settings by set the isolation width and pad isolation to 0.5 mm.
In the "Contour Routing" tab, the type of the edge cut can be adjusted which should either be the type 2/6 or 3/6 so that only two attachment points remain on opposite ends. Here, I selected the type 2/6 with horizontal gaps. The remaining settings were the default settings.
The last changes I made were in the third tab, the "Drill" tab. Behind the source, I ticked the box to "Create marking drills".
After that, I pressed "Start" which opened a window that showed the computation results with the tools the machine will be using. I closed it and by this was done with the CAM processing.
PCB Fabrication: Milling
Milling the PCB with the prepared machine file can also be done with the CircuitPro software from LKPF.
To start the process, the software supplies a board production wizard which guides the user through all steps. It is really handy because it automates tasks like zeroing the z-axis.
After pressing "Start", the user is asked to place some material on the bed. The PCB should be milled out of a previously bought sheet of FR4 with a thickness of 1.5 mm and a copper thickness of 35 microns. When buying it, the copper however has a UV-protective coat which was firstly removed with some acetone. Then, the material was placed on the bed on top of a sacrificial layer of dense cardboard and fixed with some tape.
Next, the user has to adjust the material settings. Here, the right material type (FR4), copper thickness (35 microns) and material thickness (1.5 mm) were inputted. Additionally, the location of the FR4 was set in the program. For this, it was clicked on the proposed bottom left corner in the machine area view on the right of the screen, which moved the head of the mill to the according position. After adjusting it slightly, the button "P1" in the window on the left was set. This step was repeated for the top right corner of the material and the "P2" button. With this, the position of the FR4 material on the bed was inputted into the software as you can see on the right of the screen.
After pressing "continue", another dialog opens about the placement of the board. It can be placed on the FR4 material by dragging the small board in the machine area view to the desired position.
After pressing continue, I saved the file. About 5 minutes later, the head has heated up the spindle and is ready to mill the PCB, except for one aspect. Before it will do the actual milling, it has to do a test cut to adjust the depth of the milling bit. As it is a V-bit, the thickness of the cut depends on the depth of the bit in the material.
The machine therefore ask the user to specify a position, where it can do the test cut. I specified it to be under the microcontroller as nothing will be milled or soldered there. I did this again by clicking on the desired position in the machine area view on the right of the screen. As it is positioned within the board edges, the software detects it an ask me to confirm my choice again. So, I confirmed.
After some seconds, the software shows a dialog where it asks weather the cut is in focus. The head of the machine namely has a camera which is used to detect the exact width of the cut and can automatically adjust the depth of the V-bit. That is really handy, as it automates the zeroing of the z-axis. Lastly, I confirmed the focus and it started with the whole milling process.
After the milling process, I removed the PCB from the remaining FR4 material by twisting. I furthermore used a sanding sponge to sand the copper and a fine file to round the cut edges of PCB.
The finished board, you can see in the image. The cut in the middle is the test cut for adjusting the depth of the V-bit.
Soldering on the PCB
For soldering, certain equipment is needed. The basics include lead-free solder and a soldering station, which is composed of a soldering iron with a handle and a stand as well as a soldering base which allows for changing the temperature and for cleaning the tip with some metal wool.
Additionally, a fume extractor should always be placed close to the soldering site as the melting solder can develop fumes which are hazardous to humans.
In addition to the basic tools, additional tools can make soldering a lot easier:
- Soldering flux to liquefy the solder that is too viscous in case it has been heated up too often.
- Stand with clamps and magnifying glass for stabilization of the board
- Additional light source for better view
- Fine set of tweezers to position small electrical components precisely on the board
- Desoldering suction pump for removing excess solder
Furthermore, I had to collect all components I needed to solder to the board. These were:
- SAMD21 microcontroller
- Button
- Pull-up Resistor (>10 Kiloohms)
- 2x LED
- 2x Resistor for LEDs (499 Ohms)
- 6x 1x4 Pin Headers
- 1x3 Pin Header
In the past, I only soldered very few and very easy things but that was also a while ago already. So, this is more or less my first experience with soldering. During the global and the local lecture, I was told how it is done though.
All of the components, I had to solder, were surface mount technology (SMT), except for the pin headers, which were through-hole technology (THT). Mounting components to the surface is relatively easy. First, on one of the solder pads, solder is applied. Then, the component is placed on top of it and fixed in position. While the solder iron's tip heats up to solder and melts it, the component is pressed down until it touches the board. Then, the solder iron can be removed. In some cases, the solder has the be melted again to allow for re-positioning. Once the component is fixed in the correct place on the first solder pad, the remaining pins are soldered.
For THT, the procedure is similar, but the component is not placed on the board but inserted through one or muliple holes and solder is applied on the other side.
For connecting the lead of a pin to a solder pad, the soldering procedure is the following. First, the solder iron is placed on the solder pad, also touching the component's leads. After a couple of seconds, the solder is applied from the other side, preferably not touching the iron but melting indirectly by touching the heated leads and pads. Once enough solder is applied, the solder is removed. Before removing the solder iron, it is waited for another couple of seconds. This should ideally generate volcano-shaped and shiny solder joints. In case they are dull, the solder iron should be placed on the joint again to head the solder up once more.
Soldering the SMT
I started soldering with the microcontroller. Here, I placed some solder on the top right pad of all pads of the microcontroller. Then, I placed the microcontroller on top and fixed it with a piece of insulation tape to the board in the correct position. Then, I placed the solder iron on the side of the same solder pad. It took a while but with a thick tip of the solder iron and an increased heat of 400°C, the solder finally melted and fixed the microcontroller in the correct place. I also found it easier to use a relatively thin solder as it allows me to fine-tune the amount of solder more easily and to place it more precisely. Hence, I continued using the thinner solder we had available, a thin copper alloy with 0.7 mm thickness.
Then, I proceeded with the soldering technique described above the remaining pins. I started on the right side and proceeded with the left.
This part was actually a lot easier than I thought. As you might see, the solder joints on the left are a lot more consistent and very shiny as I got more experienced.
Clamping it with the stand also helped a lot with my hand placement. With the stand, I was able to rest my hands on something to precisely position the solder and solder iron at the desired positon.
After finishing the microcontroller, I continued with the LEDs. Here, it was crucial to use a multimeter in the diode mode to assess where the ground needs to be connected to. In case you place the ground on the wrong side, the LED will not light up.
After figuring out the correct position, I again started with a bit of solder on one solder pad, which I heated up while holding the LED in the right position. Here, tweezers were essential as the LEDs were really tiny.
After the LEDs, I went on with the resistors and the button. There was no surprise anymore and was hence relatively straight forward.
Soldering the THT
After I soldered all SMT components, I was left with the pin headers. In contrast to normal THT, I did not solder them on the other side as it is normally done. But as there was no copper on the other side, I soldered them to the same side.
I had never done that before, not even watched somebody do it. Therefore, I started with the 1x4 pin header connecting to the ground as it does not really matter if I mess up the pads or accidentally connect them to the surrounding plate. Here, I started by placing a drop on the pin on one side, just below the plastic. Then, I placed the component through the hole and touched the solder with the solder iron. Most of the times, simply melting the solder generated a volcano shape in the bottom of the pin on the solder pad. Other times, I had to move the solder iron down or to use some solder flux to make the solder adhering to the solder pad. For the very first pin, I also had to melt the solder around the first pin a couple of times to get the positioning right.
After the first pin was soldered, also in the correct position, I continued with the remaining pins by inserting the solder iron from one side and then adding solder from the other. This is how it worked the best for me.
I was really happy that I started with soldering the ground pin header as I really made a mess. However, as you can see, I got a lot more experienced an the solder joints looked a lot better after some tries. They have a distinct volcano-shape and are shiny, as it should be.
However, I was not able to get the solder around the hole pin as it was too difficult to insert the solder and solder iron into the joint from both sides. Sometimes, pin headers or other components were in the way. Nevertheless, I am more than happy about how the PCB turned out!
Testing the PCB
As a very last step, the PCB must be tested in case any connection. In general, the testing is divided into two phases. First, the PCB is tested with a multimeter, e.g. whether neighboring pins are connected accidentally. This should also determine whether it is safe to plug in a cable. Then, the second phase can start by connecting the PCB to a computer (via a hub!) and testing the it with some code.
Testing With a Multimeter
Testing the PCB with a multimeter is done in the continuity mode. In case there is an electrical connection between two places, which are touched by the tips of the cables, the multimeter beeps. Hence, it can be used to detect whether a wanted connected was properly made or any unwanted connections was made accidentally. The following test should be conducted:
- No continuity between power (5V and 3.3V) and the ground to avoid short circuiting
- Continuity of ground to assess whether ground reaches wanted pins
- No continuity of neighboring pins on microcontroller
- No continuity of neighboring pins of pin header
- No continuity between pins of microcontroller and ground or pins and power (except for ground and power pins with ground and power, respectively)
- All pins on microcontroller with pins of pin headers
The case of having no continuity where there should be continuity is relatively easy. Usually, just slightly more solder is needed to make the connection. However, sometimes a trace is missing as it was not included in the design. Here, a wire could help as a work around but is not ideal as it needs to be insulated to shield it from accidental connections. This is usually not a permanent solution.
The cases of having continuity where no continuity is wanted is more difficult. Usually solder connects between leads or pins. It could help to use a desoldering suction pump or desoldering wick. Scraping the solder off from within the traces could also help but is not recommended. It might be helpful to simply melt the solder again to let it form a new shape.
While testing, I was testing for no continuity between the pins of the microcontroller and the ground. Here, I got a lot of continuity until I figured out that I accidentally touched the metal housing of the microcontroller. With knowing that, I continued testing and was really happy when I got to know that I only had the issue of no continuity where I wanted continuity. Here, I simply applied more solder to the solder pad and I was done with soldering!
Testing With Programmed Code
After the test with the multimeter were successfully accomplished, I continued with the second phase of testing. I firstly plugged the microcontroller into a socket. Here, the power LED went on, so that worked already!
Next, I plugged the PCB into my computer via a hub. In case of any short circuit, only the hub would be destroyed and not the computer. My computer also recognized the PCB as a USB Serial Device and therefore I proceeded with testing.
The second phase of testing includes programming very basic code to check whether the controls work. However, to program the microcontroller with an IDE, here the Arduino IDE, the IDE had to prepared. For this, I followed the steps on this website.
Firstly, I added the URL https://files.seeedstudio.com/arduino/package_seeeduino_boards_index.json to the list of additional board manager URLs which can be found at File > Preferences.
Next, I installed the Seeeduino board to add them to the available boards. For this, I clicked on Tools > Board > Board Manager... which opened a dialog. Here, I searched for the keyword "Seeeduino" which lead me to the required package. I installed it.
After the installation was complete, I selected the Seeeduino as the current board and set the port to "COM7" which is the port of my PCB in "Tools".
Now, after configuring the Arduino IDE, I was able to upload programmed code to the PCB. For a first test, I used an example code from File > Examples > 01.Basics > Blink. In this code, I only added a line to define the pin of the LED and then replaced LED_BUILTIN with the variable for my LED pin. The code looks like the following:
// declare and initialize pin for LED
const int ledPin = 8;// the number of the LED pin
// the setup function runs once when you press reset or power the board
void setup() {
// initialize digital pin for LED as an output.
pinMode(ledPin, OUTPUT);
}
// the loop function runs over and over again forever
void loop() {
digitalWrite(ledPin, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second
digitalWrite(ledPin, LOW); // turn the LED off by making the voltage LOW
delay(1000); // wait for a second
}
In principle, it turns on the LED, waits a second and turns it off again and waiting another second. This is also what I observed after uploading this script:
Regular Blinking of Built-In LED
As a second test, I used a script that I found here. I only change the number of the LED and button pin. This is the code:
const int buttonPin = 0; // the number of the pushbutton pin
const int ledPin = 8; // the number of the LED pin
int buttonState = 0; // variable for reading the pushbutton status
void setup() {
// initialize the LED pin as an output:
pinMode(ledPin, OUTPUT);
// initialize the pushbutton pin as an input:
pinMode(buttonPin, INPUT);
}
void loop() {
// read the state of the pushbutton value:
buttonState = digitalRead(buttonPin);
// check if the pushbutton is pressed. If it is, the buttonState is LOW:
if (buttonState == LOW) {
// turn LED on:
digitalWrite(ledPin, HIGH);
} else {
// turn LED off:
digitalWrite(ledPin, LOW);
}
}
This script simply turns on an LED if the button is pressed, i.e. if it state is LOW, and turns it off if it is not pressed, i.e. in case of HIGH. As expected, uploading this script to the SAMD21 resulted in an LED that is on only if the button is pressed:
LED Turns On When Button Is Pressed
With these two tests done, I consider the PCB as functional. I was not yet able to test the other pins, e.g. for input/output or networking. However, I guess I will be doing most of the future assignments e.g. input or output devices and networking with this board. Hence, I will potentially have tested all parts of the PCB in the future.
Design Files and Source Code for Download
- KiCAD Files (.zip): Contains the files of the KiCAD project (.kicad_pro), schematics (.kicad_sch) and PCB layout (.kicad_pcb)
- Blink LED Sketch (.ino): Arduino Sketch blinking an LED with on and off phases of one second
- Blink LED with Button Sketch (.ino): Arduino Sketch turning an LED on and off according to a button